using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Affirma.ThreeSharp.Wrapper;
using log4net;
using System.IO;

namespace CloudDrive.S3
{
    public class RemoteFileInfo
    {
        public string Name
        {
            get
            {
                string name = FullName;
                if (IsDirectory)
                    name = name.Remove(name.Length - 1);
                var lastDirectoryTerminator = name.LastIndexOf("\\");
                if (lastDirectoryTerminator > -1)
                    name = name.Substring(lastDirectoryTerminator);
                return name;
            }
        }
        public string FullName { get; set; }
        public string KeyName
        {
            get
            {
                if (FullName.StartsWith("\\"))
                    return FullName.Substring(1);
                return FullName;
            }
        }
        public string LocalFile { get; set; }
        public DateTime CreationDate { get; set; }
        public long Size { get; set; }
        public bool IsDirectory
        {
            get
            {
                return FullName.EndsWith("\\");
            }
        }
    }
}
